
*******************************************************************************
* This file plots aggregate trends
*******************************************************************************

global folder ".."

use "$folder/data_input/aggbondfundasset.dta", clear

g bond = TaxableBond + MunicipalBond


g tm=mofd(date)
merge 1:1 tm using "$folder/data_input/bank_deposits"

sort date


twoway  ///
 (area  bond date, xlabel(,format(%tdCY))) if date>=td(01jan1995) & date<=td(31dec2019), ///
  graphregion(color(white)) plotregion(color(white)) bgcolor(none) ///
	legend(off) ///
	 ytitle("Fund assets (billion)")  title("") ///	
	ylabel(, nogrid) xtitle("") 
graph export  "$folder/output/aggregate_assets_1995_2019.pdf", replace




g fund_deposit_share = bond/deposits

twoway  ///
 (area  fund_deposit_share date, xlabel(,format(%tdCY))) if date>=td(01jan1995) & date<=td(31dec2019), ///
  graphregion(color(white)) plotregion(color(white)) bgcolor(none) ///
	legend(off) ///
	 ytitle("Fixed-income fund shares / Bank deposits")  title("") ///	
	ylabel(0.15(.05).35, nogrid) xtitle("") 
graph export  "$folder/output/fund_deposit_share_1995_2019.pdf", replace

